package edu.jsnu.service.ticket.film.dao;

import edu.jsnu.service.ticket.film.domain.Film;
import edu.jsnu.service.ticket.film.dto.FilmBrief;
import edu.jsnu.service.ticket.film.dto.FilmDto;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface FilmMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Film record);

    int insertSelective(Film record);

    Film selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Film record);

    int updateByPrimaryKeyWithBLOBs(Film record);

    int updateByPrimaryKey(Film record);

    List<Film> getFilmListByTypeOrYears(@Param("filmType") String filmType, @Param("filmYears") Date filmYears , @Param("startIndex") int startIndex, @Param("filmTotal") int filmTotal);

    public List<Film> getAllFilm(int id);

    List<FilmDto> getAllFilms(@Param("status")Integer status, @Param("keyword") String keyword);

    Integer batchDel(Map<String, Integer[]> map);

    Integer updateStatus(@Param("id") Integer id, @Param("status") Integer status);


    List<FilmBrief> getBriefFilmInfo(@Param(value = "startPage")Integer startPage,
                                     @Param(value = "pageCount")Integer pageCount,
                                     @Param(value = "flag")Integer flag,
                                     @Param(value = "type")String type,
                                     @Param(value = "year")String year);

    List<FilmBrief> getBriefFilmInfoToEndDate(@Param(value = "startPage")Integer startPage,
                                     @Param(value = "pageCount")Integer pageCount,
                                     @Param(value = "type")String type,
                                     @Param(value = "year")String year,
                                     @Param("endTime") Date endTime);
    Integer getTotalCount();

    FilmDto getFilmDtoById(Integer id);

    List<Film> getFilmByStatus(Integer status);

    List<FilmBrief> getBriefFilmInfo7DaysLater(@Param(value = "startPage")Integer startPage,
                                           @Param(value = "pageCount")Integer pageCount,
                                           @Param(value = "type")String type,
                                           @Param(value = "year")String year,
                                           @Param("endTime") Date endTime);

    public List<Film> getBriefFilmByName(@Param(value = "filmName") String filmName);

    public List<Film> getHotFilms();
}